<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: sunset
  Date: 2021/8/17
  Time: 11:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html >
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>天天生鲜-商品列表</title>
    <link rel="stylesheet" type="text/css" href="../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../css/main.css">
    <link rel="stylesheet" type="text/css" href="../css/index.css">
    <script type="text/javascript" src="../js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="../js/jquery-ui.min.js"></script>
    <script>
        $(function () {
            $(".query a").click(function (){
                $(this).siblings('a').removeClass('ac');
                $(this).addClass('ac');
            });
        });
    </script>
</head>
<body>
    <div class="header_con">
        <div class="header">
            <div class="welcome fl">欢迎来到天天生鲜!</div>
            <div class="fr">
                <div class="login_btn fl">
                    <a href="${pageContext.request.contextPath}/product/login">登录</a>
                    <span>|</span>
                    <a href="register.html">注册</a>
                </div>
                <div class="user_link fl">
                    <span>|</span>
                    <a href="user_center_info.html">用户中心</a>
                    <span>|</span>
                    <a href="cart.html">我的购物车</a>
                    <span>|</span>
                    <a href="user_center_order.html">我的订单</a>
                </div>
            </div>
        </div>
    </div>
    <div class="search_bar clearfix">
        <a href="${pageContext.request.contextPath}/main/index" class="logo fl"><img src="../images/logo.png"></a>
        <form action="${pageContext.request.contextPath}/product/search" method="post" class="search_con fl">
            <input type="text" class="input_text fl" name="name" placeholder="显示全部商品">
            <input type="submit" class="input_btn fr" value="搜索">
        </form>
        <div class="guest_cart fr">
            <a href="#" class="cart_name fl">我的购物车</a>
            <div class="goods_count fl" id="show_count">${number}</div>
        </div>
    </div>
    <div class="navbar clearfix">
        <div class="subnav_con fl">
            <a href="${pageContext.request.contextPath}/main/index"><h1>全部商品分类</h1></a>
            <span></span>
            <ul class="subnav">
                <li><a href="${pageContext.request.contextPath}/product/sort?sort1=11" class="fruit" >新鲜水果</a></li>
                <li><a href="${pageContext.request.contextPath}/product/sort?sort1=12" class="seafood">海鲜水产</a></li>
                <li><a href="${pageContext.request.contextPath}/product/sort?sort1=13" class="meet">猪牛羊肉</a></li>
                <li><a href="${pageContext.request.contextPath}/product/sort?sort1=14" class="egg">新鲜蔬菜</a></li>
                <li><a href="${pageContext.request.contextPath}/product/sort?sort1=15" class="vegetables">禽类蛋品</a></li>
            </ul>
        </div>

        <div>
            <div class="search_error" style="display: ${error}">
                <img class="error_img" src="../images/error.png" alt="图片加载中..."><br>
                <span class="error_detail">抱歉，未找到相关描述的商品...</span>
            </div>
            <div style="display:${no}">
                <div class="query" >
                    <a href="${pageContext.request.contextPath}/product/ordinary?cnt=0" >默认</a>
                    <a href="${pageContext.request.contextPath}/product/ordinary?cnt=1" >人气</a>
                    <a href="${pageContext.request.contextPath}/product/ordinary?cnt=2" >价格</a>
                </div>
                <div class="product">
                    <c:forEach var="product" items="${product_list}">
                        <div class="product_list">
                            <a href="#"><img src="../images/goods/${product.id}.png" alt="图片加载中..."></a><br>
                            <span class="price">￥${product.price}</span><br>
                            &nbsp;&nbsp;
                            <a class="name" href="#">${product.name}</a>
                            <span class="weight">${product.sort2}</span>
                            <span class="weight">${product.weight}</span><br>
                            &nbsp;&nbsp;
                            <span class="hot" >人气值:${product.popularity}</span>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </div>



</body>
</html>
